import React from 'react';
import { connect, history } from 'umi';
import styles from './index.less';
import MindMap from './MindMap';
import ScatterDiagram from './ScatterDiagram';
@connect(({ SensitivityAnalysis }) => ({
  SensitivityAnalysis,
}))
export default class extends React.Component {
  state = {
    width: 0,
    height: 0,
  };
  componentDidMount = () => {
    const mindMap = document.getElementById('mindMap');
    const width = mindMap.scrollWidth;
    const height = mindMap.scrollHeight;
    this.setState({ width, height });
  };
  render() {
    const { width, height } = this.state;
    return (
      <div className={styles.RightPart}>
        <div className={styles.header}>
          <ScatterDiagram />
        </div>
        <div className={styles.body} id="mindMap">
          <MindMap width={width} height={height} />
        </div>
      </div>
    );
  }
}
